#include <bits/stdc++.h>
using namespace std;
#define int long long
#define INF 0x3f3f3f3f

signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	
	int Max = INF;
	int Min = 0;
	int n, a, b;
	cin >> n;
	while (n--)
	{
		cin >> a >> b;
		Max = min(Max, a / b);
		Min = max(Min, a / (b + 1) + 1);
	}
	cout << Min << ' ' << Max << endl;
	return 0;
}